package com.yaoyong.codegenerator.entity;

import com.yaoyong.codegenerator.constant.DatabaseType;

import java.util.List;

/**
 * 数据库信息实体模型
 *
 * @author 姚勇
 */
public class Database {
    /**
     * 数据库驱动
     */
    private String driverClassName;
    /**
     * 数据库连接url
     */
    private String url;
    /**
     * 用户名
     */
    private String username;
    /**
     * 密码
     */
    private String password;

    /**
     * 数据库类型
     */
    private DatabaseType databaseType;
    /**
     * 数据库名称
     */
    private String name;
    /**
     * 表集合
     */
    private List<Table> tables;

    public String getDriverClassName() {
        return driverClassName;
    }

    public Database setDriverClassName(String driverClassName) {
        this.driverClassName = driverClassName;
        return this;
    }

    public String getUrl() {
        return url;
    }

    public Database setUrl(String url) {
        this.url = url;
        return this;
    }

    public String getUsername() {
        return username;
    }

    public Database setUsername(String username) {
        this.username = username;
        return this;
    }

    public String getPassword() {
        return password;
    }

    public Database setPassword(String password) {
        this.password = password;
        return this;
    }

    public DatabaseType getDatabaseType() {
        return databaseType;
    }

    public Database setDatabaseType(DatabaseType databaseType) {
        this.databaseType = databaseType;
        return this;
    }

    public String getName() {
        return name;
    }

    public Database setName(String name) {
        this.name = name;
        return this;
    }

    public List<Table> getTables() {
        return tables;
    }

    public Database setTables(List<Table> tables) {
        this.tables = tables;
        return this;
    }

    @Override
    public String toString() {
        return "Database{" +
                "driverClassName='" + driverClassName + '\'' +
                ", url='" + url + '\'' +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", databaseType=" + databaseType +
                ", name='" + name + '\'' +
                ", tables=" + tables +
                '}';
    }
}
